Skip to content

feat: Add support for TRANSFER_IN and TRANSFER_OUT events#308

Open
MedAzizKhayati wants to merge 3 commits into
pytr-org:masterfrom
MedAzizKhayati:feature/transfer-events
Open

feat: Add support for TRANSFER_IN and TRANSFER_OUT events#308
MedAzizKhayati wants to merge 3 commits into
pytr-org:masterfrom
MedAzizKhayati:feature/transfer-events

Conversation

@MedAzizKhayati
Copy link
Copy Markdown

Closes #276

Description

This is my attempt to finally support TRANSFER_IN and TRANSFER_OUT events which were not mapped in the past.
These are the following actual events that are supported in this MR:

  • subtitle: "Wertpapiertransfer"
  • subtitle: "Aktien übertragen"
  • subtitle: "Aktien erhalten"

@RealCLanger
Copy link
Copy Markdown
Collaborator

Hi, looks like a sensible addition/fix. Is there something wrong with the PR?

@abulola
Copy link
Copy Markdown

abulola commented Apr 30, 2026

hi, why has this addition not made it to the main branch? It would be very useful to have "transfer in" and "transfer out" events included in the transactions export.

@MedAzizKhayati
Copy link
Copy Markdown
Author

Hi, looks like a sensible addition/fix. Is there something wrong with the PR?

Feel free to merge that, must have closed it by mistake.

@RealCLanger
Copy link
Copy Markdown
Collaborator

It has conflicts with current main branch. Would you mind resolving that?

@MedAzizKhayati MedAzizKhayati force-pushed the feature/transfer-events branch from 8a97f7c to 0efbe4e Compare May 14, 2026 11:20
Copilot AI review requested due to automatic review settings May 14, 2026 11:20
@MedAzizKhayati
Copy link
Copy Markdown
Author

It has conflicts with current main branch. Would you mind resolving that?

Resolved

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds parsing support for securities transfer timeline events so they can be exported as Portfolio Performance transfer transactions.

Changes:

  • Maps transfer-related subtitles to TRANSFER_IN / TRANSFER_OUT.
  • Adds ISIN/share parsing helpers for transfer events and cancellation handling from header status.
  • Adds transfer fixtures and expected transaction-export cases.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pytr/event.py Adds transfer event classification and parsing logic.
pytr/locale/de/LC_MESSAGES/messages.po Updates German labels for transfer transaction types.
tests/test_events.py Adds expected parsing/export assertions for transfer events.
tests/transfer_in.json Adds inbound transfer fixture.
tests/transfer_out.json Adds outbound transfer fixture.
tests/transfer_out_cancelled.json Adds cancelled outbound transfer fixture.
tests/wertpapiertransfer_in.json Adds legacy-style inbound securities transfer fixture.
tests/wertpapiertransfer_out.json Adds legacy-style outbound securities transfer fixture.
Comments suppressed due to low confidence (2)

pytr/event.py:546

  • Supporting transfers here also makes them go through the earlier fee-parsing warning path, but TRANSFER_IN/TRANSFER_OUT are not excluded from the “Could not parse fees” check. As a result, normal transfer events without a Gebühr field will emit a misleading warning before being parsed successfully.
        elif event_type in [PPEventType.TRANSFER_IN, PPEventType.TRANSFER_OUT]:
            isin = cls._parse_isin(event_dict)
            shares = cls._parse_transfer_shares(event_dict)
            value = 0  # Transfers have no monetary value

pytr/event.py:828

  • Anteile is a German field label, but this path parses it with English locale preference. Values that are valid in both locales, such as 1.234, will be interpreted as 1.234 shares instead of the German thousands value 1234, unlike the existing share parser which only uses the English preference for Aktien/Shares labels.
                if item.get("title") in ["Aktien", "Shares", "Anteile"]:
                    return cls._parse_float_from_text_value(item.get("detail", {}).get("text", ""), {}, "en")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pytr/locale/de/LC_MESSAGES/messages.po Outdated
Comment thread pytr/event.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Account Transfer" to the csv

4 participants